﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cherry.Agile.Core;
using Microsoft.Practices.Unity;
namespace Cherry.Agile.Logging
{
    /// <summary>
    /// 日志管理
    /// </summary>
    public class LoggingManager
    {
        /// <summary>
        /// 获取日志
        /// </summary>
        /// <param name="category">对应配置文件中设置好Category的Logger</param>
        /// <returns>日志</returns>
        public static ILogger GetLogger(string category = null)
        {
            if (Container.Current.IsRegistered<ILogger>())
                return Container.Current.Resolve<ILogger>(new ParameterOverride("category", category));
            else
                return new ElibLogging(category);
        }
    }
}
